package com.chenfan.mcn.model.rpc;

import com.alibaba.fastjson.annotation.JSONType;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/** 批量费用核销回款回调DTO
 * @author wulg
 * @date 2022/11/2
 */
@EqualsAndHashCode(callSuper = true)
@Data
@JSONType(typeName = BusinessScene.BATCH_CHARGE_CLEAR)
public class BatchChargeClearCallback extends AbstractFinanceCallback {


    private static final long serialVersionUID = 3471513679360104418L;

    /**
     * 数据body
     */
    @Valid
    @NotEmpty(message = "数据body不能为空")
    private List<ChargeClearCallbackBody> body;

    /**
     * 数据body
     */
    @Data
    public static class ChargeClearCallbackBody implements Serializable {

        private static final long serialVersionUID = 8404476011358165980L;
        /**
         * 费用类型
         */
        @NotNull(message = "费用类型不能为空")
        private Integer chargeType;

        /**
         * 核销单号
         */
        @NotBlank(message = "核销单号不能为空")
        private String clearNo;

        /**
         * 本次回款金额
         */
        @NotNull(message = "本次回款金额不能为空")
        private BigDecimal paybackAmount;

        /**
         * 累计回款金额
         */
        private BigDecimal totalPaybackAmount;

        /**
         * 费用来源单号
         */
        @NotBlank(message = "费用来源单号不能为空")
        private String sourceBillCode;

        /**
         * 费用来源明细
         */
        private String chargeSourceDetail;

        /**
         * 最近回款日期-若不传的话，取当前系统日期
         */
        private Date paybackDate;
    }
}
